﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace University.Workshop.Model
{
    public class Allotment
    {
        [Key]
        public int AllotmentId { get; set; }
        public string AllotmentName { get; set; }
        [ForeignKey("Square")]
        public string SquareId { get; set; }
        public virtual Square Square { get; set; }
        public bool Enable { get; set; }
        [ForeignKey("Kardex")]
        public int? KardexId { get; set; }
        public virtual Kardex Kardex
        {
            get;
            set;
        }
    }
    public class Square
    {
        [Key]
        public string SquareId { get; set; }
        public string Comment { get; set; }
        public virtual ICollection<Allotment> Allotments { get; set; }
        public bool Enable { get; set; }

        [NotMapped]
        public string EnableString
        {
            get { return Enable ? "Activo" : "Inactivo"; }
        }

        [NotMapped]
        public bool VisibilityButtonDisable
        {
            get { return (Enable); }
        }

        [NotMapped]
        public bool VisibilityButtonEnable
        {
            get { return ((!Enable)); }
        }
    }

}
